﻿@model Inscriptionem.Models.Views.MemberViewModel

@{
    ViewBag.Title = Inscriptionem.Configuration.Configuration.Instance.General.Title + " » Member » Edit";
    ViewBag.SearchText = "Search";
    Layout = "Layout.cshtml";

    string message = string.Empty;

    switch (Model.Error)
    {
        case Inscriptionem.Models.Enums.MemberError.FirstNameEmpty:
            {
                message = "Please enter First Name.";
                break;
            }

        case Inscriptionem.Models.Enums.MemberError.LastNameEmpty:
            {
                message = "Please enter Last Name.";
                break;
            }

        case Inscriptionem.Models.Enums.MemberError.PasswordLength:
            {
                message = "Please enter password, that 6 characters or longer.";
                break;
            }

        case Inscriptionem.Models.Enums.MemberError.PasswordNotMatch:
            {
                message = "Passwords does not match.";
                break;
            }

        case Inscriptionem.Models.Enums.MemberError.SiteLink:
            {
                message = "Please enter valid site link.";
                break;
            }
            
        case Inscriptionem.Models.Enums.MemberError.Other:
            {
                message = "Unknown error occurred, please try again.";
                break;
            }
    }
}

<link rel="stylesheet" href="/Content/Themes/Inscriptionem/CSS/blueprint.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="/Content/Themes/Inscriptionem/CSS/theme.css" type="text/css" media="screen">

<link rel="stylesheet" href="/Content/Themes/jQueryUI/jquery-ui.min.css" />

<script src="/Content/Scripts/jQuery/jquery.min.js"></script>
<script src="/Content/Scripts/jQueryUI/jquery-ui.min.js"></script>
<script src="/Content/Scripts/jQueryUI/jquery.ui.datepicker.min.js"></script>

<div class="outer" id="contentwrap">
    <div class="sidecont">
		<div class="sidebar sidebar-left">
			<div class="sidebaradbox"></div>
		</div>
    </div>
    <div class="postcont" style="width: 772px;">
		<div id="content">	
			<div class="post type-post status-publish format-standard hentry">
                <h2 class="title">Edit</h2>
                <div class="postdate-single error-message">@message</div>
                <hr />
                <form method="post" action="/@Inscriptionem.Localization.Language.Current.Value/Member/Edit">
                    <input type="hidden" name="ID" value="@Model.ID" />
				    <div class="entry">
                        <p>First Name <input type="text" name="FirstName" value="@Model.FirstName" /></p>
                        <p>Nick Name <input type="text" name="NickName" value="@Model.NickName" /></p>
                        <p>Last Name <input type="text" name="LastName" value="@Model.LastName" /></p>

                        <p>Birth Date <input type="text" id="BirthDate" name="BirthDate" value="@(Model.BirthDate.HasValue ? Model.BirthDate.Value.ToShortDateString() : string.Empty)" /></p>
                        <p>Mail <input type="text" name="Mail" value="@Model.Mail" disabled="disabled" /></p>

                        <hr />
                        <p>New password <input type="password" name="Password" value="" /></p>
                        <p>Confirm new password <input type="password" name="PasswordConfirmation" value="" /></p>
                        <hr />

                        <p>Description</p>
                        <p><textarea name="Description" rows="10" style="width: 762px;">@Model.Description</textarea></p>
                        <p>Site <input type="text" name="SiteLink" value="@Model.SiteLink" style="width: 300px;" /></p>
	                </div>

                    <input type="reset" value="Reset" />&nbsp;|&nbsp;<input type="submit" value="Save" />
                </form>
			</div>
		</div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $("#BirthDate").datepicker();
    });
</script>